<?php

namespace common\models\person;
use common\helpers\ArrayHelper;
use Yii;

/**
 * This is the model class for table "{{%common_ip_blacklist}}".
 *
 * @property int $id
 * @property string $merchant_id
 * @property string $remark 备注
 * @property string $ip ip地址
 * @property int $status 状态[-1:删除;0:禁用;1启用]
 * @property string $created_at 创建时间
 * @property string $updated_at 修改时间
 */
class Hobby extends \common\models\base\BaseModel
{
    /**
     * {@inheritdoc}
     */

    public static function tableName()
    {
        return '{{%hobby}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['name'], 'required'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => '爱好',
            'status' => '状态',
            'created_at' => '创建时间',
            'updated_at' => '修改时间',
        ];
    }
    public static function getCheckHobby()
    {
        // 文章标签
        $articleTags = Hobby::find()
            ->select(['id', 'name'])
            ->asArray()
            ->all();

        $tags = [];
        foreach ($articleTags as $tag) {
            $tags[$tag['id']] = $tag['name'];
        }

        return $tags;
    }


}
